package today.belief.mole.util;


import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;

/**
 * 用与偶尔的异步调用线程管理
 *
 * @Author LXH
 * @Date 2021/7/15
 * @Description 线程的管理
 */
public class ThreadPool {
    private static final Integer CORE_POOL_SIZE = 20;

    private static final ThreadFactory FACTORY = Thread::new;

    private static final ScheduledThreadPoolExecutor EXECUTOR = new ScheduledThreadPoolExecutor(CORE_POOL_SIZE, FACTORY);

    public static void execute(Runnable runnable) {
        EXECUTOR.execute(runnable);
    }

}
